ARG PHP_VER
FROM php:${PHP_VER}-fpm

# bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd 
# gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 
# odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc 
# pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection 
# session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem 
# sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
ADD ./composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

RUN cp /etc/apt/sources.list /etc/apt/sources_bak.list
WORKDIR /root/
ADD ./tencentyun.sources.list  /root/tencentyun.sources.list
RUN cat  ./tencentyun.sources.list>/etc/apt/sources.list

RUN apt update \
    && apt install -y vim \
    && apt-get install -y procps \
    && docker-php-ext-install bcmath \
    && docker-php-ext-install ctype \
    && apt install -y libzip-dev \
    && apt install -y apt-utils \
    && apt install -y zip \
    && apt install -y cron \
    && apt install -y supervisor \
    && apt install -y rsyslog \
    && apt install -y libfreetype6-dev \
    && apt install -y libjpeg62-turbo-dev \
    && apt install -y libpng-dev \
    && docker-php-ext-configure gd --with-png-dir=/usr/include --with-webp-idr=include --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd \
    && docker-php-ext-install zip \
    && docker-php-ext-install pdo \
    && docker-php-ext-install pdo_mysql

RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

EXPOSE 9000